#{extends 'main.html' /} #{set title:'ResultsAll' /}
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
    “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<head>

    <!--    <script src="../../../public/javascripts/jquery-1.5.1.min.js"
        type="text/javascript"></script>
        <script src="../../../public/javascripts/jquery-ui-1.8.13.custom.min.js"
        type="text/javascript"></script>

        <link rel="stylesheet" href="../../../public/stylesheets/blitzer/jquery-ui-1.8.13.custom.css" type="text/css" media="screen" />-->

    <script>


        function validate_form (searchWord )
        {
            valid = true;

            if ( searchWord == "" || searchWord==" ")
            {
                $('#one').jGrowl("Please fill in the word to search for");
                //alert ( "Please fill in the search word" );
                valid = false;
            }

            return valid;
        }

        function ResultsAjaxOrganization(search,page) {

            if(search!=""){

         
                $.getJSON('@{QuickSearchRendering.searchAjaxOrganization()}',{'search':search,'page':page,'sort':document.searchFormOrganization.filter.value}, function(data) {

                    if (data != null) {
                        $("#noOrganization").html("");
                        var s={};
                        s=data.resultsOrganization.split("&");
                        var d={};
                        d=data.idsOrganization.split("&");
                        // if(s.length>0){

                        $("#printingInfoOrganization").html("Found"+data.countOrganization+"mamber(s) matching"+data.search+".");

                        var results = "";
                        for(var i = 0 ; i < s.length ; i=i+1)

                        results+="<p><a href='/Application/OrganizationView?name="+s[i]+"'>"+s[i]+"</a></p>";


                    $("#resultsDisplayOrganization").html(results);

                    if(data.page*1==1){
                        $("#previousOrganization").hide();
                    }
                    else{$("#previousOrganization").show();}
                    if(data.page*10>=data.countOrganization){
                        $("#nextOrganization").hide();
                    }else{
                        $("#nextOrganization").show();
                    }
                    document.getElementById("searchO").value=data.search;

                    document.getElementById("pageOrganization").value=data.page;
                    document.getElementById("resultsOrganization").value=results;

                    //  }




                }else{$("#previousOrganization").hide();
                    $("#nextOrganization").hide();
                    $("#printingInfoOrganization").html("");
                    $("#resultsDisplayOrganization").html("");
                    $("#noOrganization").html("Sorry! We did not find any results matching"+"'"+search);
                }

            });

        }}
    function ResultsAjaxEntity(search,page) {

        if(search!=""){

            
            $.getJSON('@{QuickSearchRendering.searchAjaxEntity()}',{'search':search,'page':page,'sort':document.searchFormEntity.filter.value}, function(data) {

                if (data != null) {
                    $("#noEntity").html("");
                    var s={};
                    s=data.resultsEntity.split("&");
                    var d={};
                    d=data.idsEntity.split("&");
                    // if(s.length>0){

                    $("#printingInfoEntity").html("Found"+data.countEntity+"mamber(s) matching"+data.search+".");

                    var results = "";
                    for(var i = 0 ; i < s.length ; i=i+1)

                    results+="<p><a href='/Application/EntityView?entityId="+d[i]+"'>"+s[i]+"</a></p>";


                $("#resultsDisplayEntity").html(results);

                if(data.page*1==1){
                    $("#previousEntity").hide();
                }
                else{$("#previousEntity").show();}
                if(data.page*10>=data.countEntity){
                    $("#nextEntity").hide();
                }else{
                    $("#nextEntity").show();
                }
                document.getElementById("searchE").value=data.search;
                document.getElementById("pageEntity").value=data.page;
                document.getElementById("resultsEntity").value=results;

                //  }




            }else{$("#previousEntity").hide();
                $("#nextEntity").hide();
                $("#printingInfoEntity").html("");
                $("#resultsDisplayEntity").html("");
                $("#noEntity").html("Sorry! We did not find any results matching"+"'"+search);
            }

        });

    }}
function ResultsAjaxTopic(search,page) {
    if(search!=""){

        $.getJSON('@{QuickSearchRendering.searchAjaxTopic()}',{'search':search,'page':page,'sort':document.searchFormTopic.filter.value}, function(data) {

            if (data != null) {
                $("#noTopic").html("");
                var s={};
                s=data.resultsTopic.split("&");
                var d={};
                d=data.idsTopic.split("&");
                // if(s.length>0){

                $("#printingInfoTopic").html("Found"+data.countTopic+"mamber(s) matching"+data.search+".");

                var results = "";
                for(var i = 0 ; i < s.length ; i=i+1)

                results+="<p><a href='/TopicIdeaController/checkAuthorizationToViewTopic?topicId="
                +d[i]+"'>"+s[i]+"</a></p>";
            ;


            $("#resultsDisplayTopic").html(results);

            if(data.pageTopic*1==1){
                $("#previousTopic").hide();
            }
            else{$("#previousTopic").show();}
            if(data.pageTopic*10>=data.countTopic){
                $("#nextTopic").hide();
            }else{
                $("#nextTopic").show();
            }
            document.getElementById("searchT").value=data.search;
            document.getElementById("pageTopic").value=data.pageTopic;
            document.getElementById("resultsTopic").value=results;

            //  }




        }else{$("#previousTopic").hide();
            $("#nextTopic").hide();
            $("#printingInfoTopic").html("");
            $("#resultsDisplayTopic").html("");
            $("#noTopic").html("Sorry! We did not find any results matching"+"'"+search);
        }

    });

}}
function ResultsAjaxIdea(search,page) {
if(search!=""){

    $.getJSON('@{QuickSearchRendering.searchAjaxIdea()}',{'search':search,'page':page,'sort':document.searchFormIdea.filter.value}, function(data) {

        if (data != null) {
            $("#noIdea").html("");
            var s={};
            s=data.resultsIdea.split("&");
            var d={};
            d=data.idsIdea.split("&");
            // if(s.length>0){

            $("#printingInfoIdea").html("Found"+data.countIdea+"mamber(s) matching"+data.search+".");

            var results = "";
            for(var i = 0 ; i < s.length ; i=i+1)

            results+="<p><a href='/TopicIdeaController/checkAuthorizationToViewIdea?ideaId="
            +d[i]+"'>"+s[i]+"</a></p>";


        $("#resultsDisplayIdea").html(results);

        if(data.pageIdea*1==1){
            $("#previousIdea").hide();
        }
        else{$("#previousIdea").show();}
        if(data.pageIdea*10>=data.countIdea){
            $("#nextIdea").hide();
        }else{
            $("#nextIdea").show();
        }
        document.getElementById("searchI").value=data.search;
        document.getElementById("pageIdea").value=data.pageIdea;
        document.getElementById("resultsIdea").value=results;

        //  }




    }else{$("#previousIdea").hide();
        $("#nextIdea").hide();
        $("#printingInfoIdea").html("");
        $("#resultsDisplayIdea").html("");
        $("#noIdea").html("Sorry! We did not find any results matching"+"'"+search);
    }

});

}}

function ResultsAjaxTag(search,page) {

if(search!=""){

$.getJSON('@{QuickSearchRendering.searchAjaxTag()}',{'search':search,'page':page,'sort':document.searchFormTag.filter.value}, function(data) {

    if (data != null) {
        $("#noTag").html("");
        var s={};
        s=data.resultsTag.split("&");
        // var d={};
        //d=data.idsTag.split("&");
        // if(s.length>0){

        $("#printingInfoTag").html("Found"+data.countTag+"mamber(s) matching"+data.search+".");

        var results = "";
        for(var i = 0 ; i < s.length ; i=i+1)

        results+="<p><a href='/TagPage/TagView?name="+s[i]+"'>"+s[i]+"</a></p>";


    $("#resultsDisplayTag").html(results);

    if(data.page*1==1){
        $("#previousTag").hide();
    }
    else{$("#previousTag").show();}
    if(data.page*10>=data.countTag){
        $("#nextTag").hide();
    }else{
        $("#nextTag").show();
    }
    document.getElementById("searchG").value=data.search;
    document.getElementById("pageTag").value=data.page;
    document.getElementById("resultsTag").value=results;

    //  }




}else{$("#previousTag").hide();
    $("#nextTag").hide();
    $("#printingInfoTag").html("");
    $("#resultsDisplayTag").html("");
    $("#noTag").html("Sorry! We did not find any results matching"+"'"+search);
}

});

}}
function ResultsAjaxActionplan(search,page) {

if(search!=""){

$.getJSON('@{QuickSearchRendering.searchAjaxActionplan()}',{'search':search,'page':page,'sort':document.searchFormActionplan.filter.value}, function(data) {

if (data != null) {
    $("#noActionplan").html("");
    var s={};
    s=data.resultsActionplan.split("&");
    var d={};
    d=data.idsActionplan.split("&");
    // if(s.length>0){

    $("#printingInfoActionplan").html("Found"+data.countActionplan+"mamber(s) matching"+data.search+".");

    var results = "";
    for(var i = 0 ; i < s.length ; i=i+1)

    results+="<p><a href='/ActionPlanController/ActionPlanOrganizer?actionPlanId="+d[i]+"'>"+s[i]+"</a></p>";


$("#resultsDisplayActionplan").html(results);

if(data.page*1==1){
    $("#previousActionplan").hide();
}
else{$("#previousActionplan").show();}
if(data.page*10>=data.countActionplan){
    $("#nextActionplan").hide();
}else{
    $("#nextActionplan").show();
}
document.getElementById("searchA").value=data.search;
document.getElementById("pageActionplan").value=data.page;
document.getElementById("resultsActionplan").value=results;

//  }




}else{$("#previousActionplan").hide();
$("#nextActionplan").hide();
$("#printingInfoActionplan").html("");
$("#resultsDisplayActionplan").html("");
$("#noActionplan").html("Sorry! We did not find any results matching"+"'"+search);
}

});

}}
function ResultsAjaxMember(search,page) {

if(search!=""){
$.getJSON('@{QuickSearchRendering.searchAjaxMember()}',{'search':search,'page':page}, function(data) {

if (data != null) {
$("#noMember").html("");
var s={};
s=data.resultsMember.split("&");
var d={};
d=data.idsMember.split("&");
// if(s.length>0){

$("#printingInfoMember").html("Found"+data.countMember+"mamber(s) matching"+data.search+".");

var results = "";
for(var i = 0 ; i < s.length ; i=i+1)

results+="<p><a href='/UserProfile/OtherUserProfile?userId="+d[i]+"'>"+s[i]+"</a></p>";


$("#resultsDisplayMember").html(results);

if(data.page*1==1){
$("#previousMember").hide();
}
else{$("#previousMember").show();}
if(data.page*10>=data.countMember){
$("#nextMember").hide();
}else{
$("#nextMember").show();
}
document.getElementById("searchM").value=data.search;
document.getElementById("pageMember").value=data.page;
document.getElementById("resultsMember").value=results;

//  }




}else{$("#previousMember").hide();
$("#nextMember").hide();
$("#printingInfoMember").html("");
$("#resultsDisplayMember").html("");
$("#noMember").html("Sorry! We did not find any results matching"+"'"+search);
}

});

}}
$(document).ready(function(){
$("#tabs").tabs();
$("#previousOrganization").hide();
if('${resultsOrganization.count}'==0){
$("#printingInfoOrganization").html("");
$("#resultsDisplayOrganization").html("");
}else{
$("#noOrganization").html("");
}
if('${resultsOrganization.count}'<10){

$("#nextOrganization").hide();
}
$("#previousEntity").hide();
if('${resultsEntity.count}'==0){
$("#printingInfoEntity").html("");
$("#resultsDisplayEntity").html("");
}else{
$("#noEntity").html("");
}
if('${resultsEntity.count}'<10){

$("#nextEntity").hide();
}
$("#previousTopic").hide();
$("#previousIdea").hide();
if('${resultsTopic.count}'==0){
$("#printingInfoTopic").html("");
$("#resultsDisplayTopic").html("");
}    else{
$("#noTopic").html("");
}
if('${resultsIdea.count}'==0){
$("#printingInfoIdea").html("");
$("#resultsDisplayIdea").html("");
}   else{
$("#noIdea").html("");
}

if('${resultsTopic.count}'<10){

$("#nextTopic").hide();
}

if('${resultsIdea.count}'<10){

$("#nextIdea").hide();
}

$("#previousTag").hide();
if('${resultsTag.count}'==0){
$("#printingInfoTag").html("");
$("#resultsDisplayTag").html("");
}else{
$("#noTag").html("");
}
if('${resultsTag.count}'<10){

$("#nextTag").hide();
}

$("#previousActionplan").hide();
if('${resultsActionplan.count}'==0){
$("#printingInfoActionplan").html("");
$("#resultsDisplayActionplan").html("");
}else{
$("#noActionplan").html("");
}
if('${resultsActionplan.count}'<10){

$("#nextActionplan").hide();
}

$("#previousMember").hide();
if('${resultsMember.count}'==0){
$("#printingInfoMember").html("");
$("#resultsDisplayMember").html("");
}else{
$("#noMember").html("");
}
if('${resultsMember.count}'<10){

$("#nextMember").hide();
}
});


function onKeyUp(searchWord,type,element){
if(type==1)
ResultsAjaxOrganization(searchWord,1);
if(type==2)
ResultsAjaxEntity(searchWord,1);
if(type==3)
ResultsAjaxTopic(searchWord,1);
if(type==4)
ResultsAjaxIdea(searchWord,1);
if(type==7)
ResultsAjaxTag(searchWord,1);
if(type==5)
ResultsAjaxActionplan(searchWord,1);
if(type==6)
ResultsAjaxMember(searchWord,1);

//getTags(searchWord,element);

}

//function getTags(search,element){
//
//if(search!=""){
//$(function() {
//$.getJSON('@{QuickSearchRendering.autoComplete()}',{'search':search}, function(data) {
//$( element ).autocomplete({
//source: data.tags.split("&")
//});});
//
//});
//}
//}


function sendEntRequest(entName) {
	
	
	$.getJSON('@{TopicIdeaController.requestToJoinEntity()}', {'entityName':entName}, function(data) {
		
		alert(data.result);
	});
}

function sendOrgRequest(orgName) {
	
	alert("orgName");
	$.getJSON('@{TopicIdeaController.requestToJoinOrganization()}', {'organizationName':orgName}, function(data) {
		
		alert(data.result);
	});
}

    </script>
</head>
<body>
    <div id="content">
        <div id="tabs">
            <ul>
                <li><a href="#tabs-1">Organization</a></li>
                <li><a href="#tabs-2">Entity</a></li>
                <li><a href="#tabs-3">Topic</a></li>
                <li><a href="#tabs-4">Idea</a></li>
                <li><a href="#tabs-5">ActionPlan</a></li>
                <li><a href="#tabs-6">Member</a></li>
                <li><a href="#tabs-7">Tag</a></li>
            </ul>


            <div id="tabs-1">

                <div id="searchdivOrganization">
                    <form name="searchFormOrganization"
                          action="javascript:ResultsAjaxActionplan(document.searchFormOrganization.search.value,1);"
                          onsubmit="return validate_form (document.searchFormOrganization.search.value );">
                        <select name="filter">
                            <option value="views">NumberOfViewsDsc</option>
                            <option value="members">NumberOfMembersDsc</option>
                            <option value="date">DateDsc</option>
                            <option value="rate">RateDsc</option>
                            <option value="viewsasc">NumberOfViewsAsc</option>
                            <option value="membersasc">NumberOfMembersAsc</option>
                            <option value="dateasc">DateAsc</option>
                            <option value="rateasc">RateAsc</option>

                        </select>
                        <input type="text" id="searchOrganization" name="search" value=""
                               onkeyup="javascript:onKeyUp(document.searchFormOrganization.search.value,1
       ,'#searchOrganization');"/>

                        <input type="submit" id="submit" name="submit" value="Search" />
                    </form>
                </div>

                <h1>Search Results Organizations</h1>
                <input type="hidden"  id="searchO" value=${search} />
                <!--                <input type="hidden"  id="sortO" value="relevance"/>-->
                <input type="hidden"   id="pageOrganization" value='${page}' />
                <input type="hidden"  id="resultsOrganization" value=""/>




                <div id ="printingInfoOrganization">

                    Found ${resultsOrganization.count} item${resultsOrganization.count.pluralize()} matching '${search}'.


                </div>
                <div id="previousOrganization" style="visibility: visible">
                    <p><a href="#" onclick="javascript:ResultsAjaxOrganization(document.getElementById('searchO').value
,(document.getElementById('pageOrganization').value)*1-1
);">previous</a></p>

                </div>

                <div id="nextOrganization" style="visibility:visible">

                    <p><a href="#" onclick="javascript:ResultsAjaxOrganization(document.getElementById('searchO').value
,(document.getElementById('pageOrganization').value)*1+1
);">next</a></p>

                </div>
                <div id="resultsDisplayOrganization">

                    #{list items:resultsOrganization.items, as:'item'}
                    <p><a href="@{Application.OrganizationView(item.name)}">${item.name}</a>  --------> <button href='#' onclick='sendOrgRequest("${item.name}")'>Join</Button></p>
                    #{/list}

                </div>



                <div id="noOrganization">

                    Sorry! We did not find any results matching '${search}'

                </div>

            </div>
            <div id="tabs-2">

                <div id="searchdivEntity">
                    <form name="searchFormEntity"
                          action="javascript:ResultsAjaxActionplan(document.searchFormEntity.search.value,1);"
                          onsubmit="return validate_form (document.searchFormEntity.search.value );">
                        <select name="filter">
                            <option value="views">NumberOfViewsDsc</option>

                            <option value="date">DateDsc</option>
                            <option value="rate">RateDsc</option>
                            <option value="viewsasc">NumberOfViewsAsc</option>

                            <option value="dateasc">DateAsc</option>
                            <option value="rateasc">RateAsc</option>

                        </select>

                        <input type="text" id="searchEntity" name="search" value=""
                               onkeyup="javascript:onKeyUp(document.searchFormEntity.search.value,2,
       '#searchEntity');"/>

                        <input type="submit" id="submit" name="submit" value="Search" />
                    </form>
                </div>

                <input type="hidden"  id="searchE" value=${search} />

                <input  type="hidden"  id="pageEntity" value='${page}' />
                <input type="hidden"   id="resultsEntity" value=""/>



                <h1>Search Results Entities</h1>

                <div id ="printingInfoEntity">

                    Found ${resultsEntity.count} item${resultsEntity.count.pluralize()} matching '${search}'.
            
                </div>
                <div id="previousEntity" style="visibility: visible">
                    <p><a href="#" onclick="javascript:ResultsAjaxEntity(document.getElementById('searchE').value
,(document.getElementById('pageEntity').value)*1-1
);">previous</a></p>

                </div>

                <div id="nextEntity" style="visibility:visible">

                    <p><a href="#" onclick="javascript:ResultsAjaxEntity(document.getElementById('searchE').value
,(document.getElementById('pageEntity').value)*1+1
);">next</a></p>

                </div>
                <div id="resultsDisplayEntity">

                    #{list items:resultsEntity.items, as:'item'}
                    <p><a href="@{Application.EntityView(item.id)}">${item.name}</a>  --------> <button href='#' onclick='sendEntRequest("${item.name}")'>Join</Button></p>
                    #{/list}

                </div>

                <!--<div id="results2">
                    <p> </p>
                </div>-->


                <div id="noEntity">

                    Sorry! We did not find any results matching '${search}'

                </div>

            </div>
            <div id="tabs-3">
                <div id="searchdivTopic">
                    <form name="searchFormTopic"
                          action="javascript:ResultsAjaxActionplan(document.searchFormTopic.search.value,1);"
                          onsubmit="return validate_form (document.searchFormTopic.search.value );">
                        <select name="filter">
<!--                            <option value="relevance">Relevance</option>-->
                            <option value="views">NumberOfViewsDsc</option>

                            <option value="date">DateDsc</option>
                            <option value="rate">RateDsc</option>
                            <option value="viewsasc">NumberOfViewsAsc</option>

                            <option value="dateasc">DateAsc</option>
                            <option value="rateasc">RateAsc</option>

                        </select>

                        <input type="text" id="searchTopic" name="search" value=""
                               onkeyup="javascript:onKeyUp(document.searchFormTopic.search.value,3,
       '#searchTopic');"/>

                        <input type="submit" id="submit" name="submit" value="Search" />
                    </form>
                </div>

                <h1>Search Results Topics</h1>
                <input type="hidden"  id="searchT" value=${search} />

                <input type="hidden"  id="pageTopic" value='${page}' />
                <input type="hidden"  id="resultsTopic" value=""/>



                <div id ="printingInfoTopic">

                    Found ${resultsTopic.count} item${resultsTopic.count.pluralize()} matching '${search}'.

                </div>
                <div id="previousTopic" style="visibility: visible">
                    <p><a href='#' onclick="javascript:ResultsAjaxTopic(document.getElementById('searchT').value
,(document.getElementById('pageTopic').value)*1-1

);">previous</a></p>

                </div>

                <div id="nextTopic" style="visibility:visible">

                    <p><a href='#' onclick="javascript:ResultsAjaxTopic(document.getElementById('searchT').value
,(document.getElementById('pageTopic').value)*1+1
);">next</a></p>

                </div>
                <div id="resultsDisplayTopic">

                    #{list items:resultsTopic.items, as:'item'}

                    <p><a href="@{TopicIdeaController.checkAuthorizationToViewTopic(item.id)}">${item.title}</a></p>
                    #{/list}

                </div>

                <div id="noTopic">

                    Sorry! We did not find any results matching '${search}'

                </div>

            </div>
            <div id="tabs-4">
                <div id="searchdivIdea">
                    <form name="searchFormIdea"
                          action="javascript:ResultsAjaxActionplan(document.searchFormIdea.search.value,1);"
                          onsubmit="return validate_form (document.searchFormIdea.search.value );">
                        <select name="filter">
<!--                            <option value="relevance">Relevance</option>-->
                            <option value="views">NumberOfViewsDsc</option>
                            <option value="vote">NumberOfVotesDsc</option>
                            <option value="date">DateDsc</option>
                            <option value="rate">RateDsc</option>
                            <option value="viewsasc">NumberOfViewsAsc</option>
                            <option value="voteasc">NumberOfVotesAsc</option>
                            <option value="dateasc">DateAsc</option>
                            <option value="rateasc">RateAsc</option>

                        </select>

                        <input type="text" id="searchIdea" name="search" value=""
                               onkeyup="javascript:onKeyUp(document.searchFormIdea.search.value,4,
       '#searchIdea');"/>

                        <input type="submit" id="submit" name="submit" value="Search" />
                    </form>
                </div>


                <h1>Search Results Ideas</h1>
                <input type="hidden"  id="searchI" value=${search} />

                <input type="hidden"  id="pageIdea" value='${page}' />
                <input type="hidden"  id="resultsIdea" value=""/>



                <div id ="printingInfoIdea">

                    Found ${resultsIdea.count} item${resultsIdea.count.pluralize()} matching '${search}'.
            
                </div>
                <div id="previousIdea" style="visibility: visible">
                    <p><a href='#' onclick="javascript:ResultsAjaxIdea(document.getElementById('searchI').value
,(document.getElementById('pageIdea').value)*1-1
);">previous</a></p>

                </div>

                <div id="nextIdea" style="visibility:visible">

                    <p><a href='#' onclick="javascript:ResultsAjaxIdea(document.getElementById('searchI').value
,(document.getElementById('pageIdea').value)*1+1
);">next</a></p>

                </div>
                <div id="resultsDisplayIdea">

                    #{list items:resultsIdea.items, as:'item'}

                    <p><a href="@{TopicIdeaController.checkAuthorizationToViewIdea(item.id)}">${item.description}</a></p>
                    #{/list}

                </div>


                <div id="noIdea">

                    Sorry! We did not find any results matching '${search}'

                </div>
            </div>
            <div id="tabs-5">
                <div id="searchdivActionplan">
                    <form name="searchFormActionplan"
                          action="javascript:ResultsAjaxActionplan(document.searchFormActionplan.search.value,1);"
                          onsubmit="return validate_form (document.searchFormActionplan.search.value );">
                        <select name="filter">
                            <option value="views">NumberOfViewsDsc</option>

                            <option value="date">DateDsc</option>
                            <option value="rate">RateDsc</option>
                            <option value="viewsasc">NumberOfViewsAsc</option>

                            <option value="dateasc">DateAsc</option>
                            <option value="rateasc">RateAsc</option>

                        </select>

                        <input type="text" id="searchActionplan" name="search" value=""
                               onkeyup="javascript:onKeyUp(document.searchFormActionplan.search.value,5,
       '#searchActionplan');"/>

                        <input type="submit" id="submit" name="submit" value="Search" />
                    </form>
                </div>


                <h1>Search Results Actionplans</h1>
                <input type="hidden"  id="searchA" value=${search} />

                <input  type="hidden"  id="pageActionplan" value='${page}' />
                <input  type="hidden" id="resultsActionplan" value=""/>

                <div id ="printingInfoActionplan">

                    Found ${resultsActionplan.count} item${resultsActionplan.count.pluralize()} matching '${search}'.
            
                </div>
                <div id="previousActionplan" style="visibility: visible">
                    <p><a href="#" onclick="javascript:ResultsAjaxActionplan(document.getElementById('searchA').value
,(document.getElementById('pageActionplan').value)*1-1
);">previous</a></p>

                </div>

                <div id="nextActionplan" style="visibility:visible">

                    <p><a href="#" onclick="javascript:ResultsAjaxActionplan(document.getElementById('searchA').value
,(document.getElementById('pageActionplan').value)*1+1
);">next</a></p>

                </div>
                <div id="resultsDisplayActionplan">

                    #{list items:resultsActionplan.items, as:'item'}
                    <p><a href="@{ActionPlanController.ActionPlanOrganizer(item.id)}">${item.name}</a></p>
                    #{/list}

                </div>


                <div id="noActionplan">

                    Sorry! We did not find any results matching '${search}'

                </div>

            </div>
            <div id="tabs-6">
                <div id="searchdivMember">
                    <form name="searchFormMember"
                          action="javascript:ResultsAjaxActionplan(document.searchFormMember.search.value,1);"
                          onsubmit="return validate_form (document.searchFormMember.search.value );">

                        <input type="text" id="searchMember" name="search" value=""
                               onkeyup="javascript:onKeyUp(document.searchFormMember.search.value,6,
       '#searchMember');"/>

                        <input type="submit" id="submit" name="submit" value="Search" />
                    </form>
                </div>

                <h1>Search Results Members</h1>
                <input type="hidden"  id="searchM" value=${search} />

                <input  type="hidden"  id="pageMember" value='${page}' />
                <input  type="hidden" id="resultsMember" value=""/>



                <div id ="printingInfoMember">

                    Found ${resultsMember.count} item${resultsMember.count.pluralize()} matching '${search}'.
            
                </div>
                <div id="previousMember" style="visibility: visible">
                    <p><a href="#" onclick="javascript:ResultsAjaxMember(document.getElementById('searchM').value
,(document.getElementById('pageMember').value)*1-1
);">previous</a></p>

                </div>

                <div id="nextMember" style="visibility:visible">

                    <p><a href="#" onclick="javascript:ResultsAjaxMember(document.getElementById('searchM').value
,(document.getElementById('pageMember').value)*1+1
);">next</a></p>

                </div>
                <div id="resultsDisplayMember">

                    #{list items:resultsMember.items, as:'item'}
                    <p><a href="@{UserProfile.OtherUserProfile(item.id)}">${item.username}</a></p>
                    #{/list}

                </div>


                <div id="noMember">

                    Sorry! We did not find any results matching '${search}'

                </div>
            </div>
            <div id="tabs-7">
                <div id="searchdivTag">
                    <form name="searchFormTag"
                          action="javascript:ResultsAjaxActionplan(document.searchFormTag.search.value,1);"
                          onsubmit="return validate_form (document.searchFormTag.search.value );">
                        <select name="filter">
                            <option value="relatedItems">NumberOfRelatedItemsDsc</option>

                            <option value="date">DateDsc</option>

                            <option value="relatedItemsasc">NumberOfRelatedItemsAsc</option>
                            <option value="dateasc">DateAsc</option>


                        </select>

                        <input type="text" id="searchTag" name="search" value=""
                               onkeyup="javascript:onKeyUp(document.searchFormTag.search.value,7,
       '#searchTag');"/>

                        <input type="submit" id="submit" name="submit" value="Search" />
                    </form>
                </div>
                <h1>Search Results Tags</h1>
                <input type="hidden"  id="searchG" value=${search} />

                <input  type="hidden"  id="pageTag" value='${page}' />
                <input type="hidden"   id="resultsTag" value=""/>

                <div id ="printingInfoTag">

                    Found ${resultsTag.count} item${resultsTag.count.pluralize()} matching '${search}'.
            
                </div>
                <div id="previousTag" style="visibility: visible">
                    <p><a href="#" onclick="javascript:ResultsAjaxTag(document.getElementById('searchG').value
,(document.getElementById('pageTag').value)*1-1
);">previous</a></p>

                </div>

                <div id="nextTag" style="visibility:visible">

                    <p><a href="#" onclick="javascript:ResultsAjaxTag(document.getElementById('searchG').value
,(document.getElementById('pageTag').value)*1+1
);">next</a></p>

                </div>
                <div id="resultsDisplayTag">

                    #{list items:resultsTag.items, as:'item'}
                    <p><a href="@{TagPage.TagView(item.name)}">${item.name}</a></p>
                    #{/list}

                </div>


                <div id="noTag">

                    Sorry! We did not find any results matching '${search}'

                </div>
            </div>
        </div>
    </div>


</body>